package com.cyy.system.controller;

import com.cyy.common.domain.Response;
import com.cyy.common.service.EmailService;
import io.swagger.v3.oas.annotations.Operation;
import io.swagger.v3.oas.annotations.tags.Tag;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * <p>
 * 系统配置 前端控制器
 * </p>
 *
 * @author 曹云友
 * @since 2024-03-28
 */
@Tag(name = "邮件", description = "邮件")
@RestController
@RequestMapping("/system/email")
@RequiredArgsConstructor
public class EmailController {

    private final EmailService emailService;


    @Operation(summary = "获取注册验证码", description = "获取注册验证码")
    @PostMapping("/registerCode")
    public Response sendRegisterCode(String email) {
        emailService.sendRegisterCode(email);
        return Response.success().msg("注册码已下发至您的邮箱，请注意查收");
    }
}
